<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>供应商平台</title>
</head>
<body class="tob-wrap">
	<div th:replace="common/top"></div>
	<article class="container container-b1-supplier clearfix">
		<div th:replace="common/left::side"></div>
		<section class="content">
			<div class="m-crumb">
				<p>
					<a href="#">订单管理 > </a> <span>创建发货单</span>
				</p>
			</div>
			<div class="m-order-info">
				<table width="100%" summay="" cellpadding="0" cellspacing="0">
					<tr>
						<td>
							<p  style="display:none" ><input id ="salesOrderID"   name="salesOrderID" th:value="${salesOrder.id}" /></p>
							<p th:text="'订单编号：'+${salesOrder.salesOrderNo}">订单编号：1234567890</p>
							<p th:text="'发货单号：'+${date}">不确定字段！！！！！！！！！！！</p>
							<p>总金额：<span th:text="${salesOrder.currency eq 0}? '￥':'$'"/><span th:text="${#numbers.formatInteger(salesOrder.price,1)}"/></p>
						</td>
						<td>
							<p>时   间：<label th:if="${salesOrder.startTime ne null and salesOrder.expiredTime ne null}" th:text="${#dates.format(salesOrder.startTime, 'yyyy-MM-dd')}+'
							 至 '+${#dates.format(salesOrder.expiredTime, 'yyyy-MM-dd')}"/></p>
							<p  th:text="'采购商：'+${salesOrder.tCompany.companyName}"></p>
							<p  th:text="'送货地址：'+${salesOrder.deliverAddress}"></p>
						</td>
						<td class="w150 txR">
							<p>
								<input type="file" id="b1tnFile" name="b1tnFile" hidden="hidden" onchange="fileName.text=this.value;fileupLoad()"/>
								<a class="btn btn-cyan" onclick="b1tnFile.click()">上传发货单复印件</a>
							</p>
							<p>
								<span id="fileName">文件名A.pdf</span> <a href="http://w1buy.b0.upaiyun.com/D:/aa.png" download="aaa">-删除</a>
							</p>
						</td>
					</tr>
				</table>
			</div>
			<form id="formPersonal">
			<div class="m-table-sell" >
				<div class="m-table-cont">
					<table width="100%" summay="" cellpadding="0" cellspacing="0">
						<thead>
							<tr>
								<th>序号</th>
								<th>商品</th>
								<th>最大可发货数量</th>
								<th>本次发货数量</th>
								<th>单位</th>
								<th>发货时间</th>
								<th>
									<!--操作-->
								</th>
							</tr>
						</thead>
							
						<tbody>
							<tr th:each="salesOrdersItem,index : ${salesOrderItems}">
								<input type="hidden" th:value="${salesOrdersItem.id}" name="id"/>
								<input type="hidden" th:value="${salesOrdersItem.tMaterialMasterClient.id}" name="materialId"/>
								<input type="hidden" th:value="${salesOrdersItem.subTotal}" name="quantityConfirmed"/>
								<input type="hidden" th:value="${salesOrder.id}" name="salesOrderID"/>
								<input type="hidden" th:value="${salesOrdersItem.quantityDelivered}" name="oldquantityDelivered"/>
								<input type="hidden" th:value="${salesOrdersItem.subTotal}" name="subTotal"/>
								<td>
									<span name="salesOrderIndex" id="salesOrderIndex" th:if="${#strings.length(index.count) eq 1}" th:text="${#strings.prepend(index.count,'00')}"/>
                    				<span name="salesOrderIndex" id="salesOrderIndex" th:if="${#strings.length(index.count) eq 2}" th:text="${#strings.prepend(index.count,'0')}"/>
                    				<span name="salesOrderIndex" id="salesOrderIndex" th:if="${#strings.length(index.count) eq 3}" th:text="${index.count}"/>
                    			</td>							
								<td class="w150">
									<p>
										<img width="70" height="40" alt="" th:if="${salesOrdersItem.tMaterialMasterClient.materialPic ne null}" th:src="${salesOrdersItem.tMaterialMasterClient.materialPic}"/>
									</p>
									<p th:text="${salesOrdersItem.tMaterialMasterClient.materialName}">每行最多十二个字多了折行</p>
								</td>
								<td th:text="${salesOrdersItem.quantity}-${salesOrdersItem.quantityDelivered}">220150</td>
								<td><input class="input" type="text" placeholder="请输入" name="quantityDelivered" id="quantityDelivered"/></td>
								<td><span th:text="${salesOrdersItem.tUnit.unitName}">公斤</span></td>
								<td class="w100">
									<p class="p-calendar">
										<input class="input input-datepicker" type="text" th:value="${actualTime}" name="actualTime" />
										<i class="icon icon-calendar"></i>
									</p>
								</td>
								<td>
									<!--<a href="#">删除改行</a>-->
								</td>
							</tr>
						</tbody>
						
					</table>
				</div>
			</div>
			</form>		
			<div class="btn-bar txC">
				<button class="btn btn-cyan" onclick="javascript:submitSalesOrderResult();">确定创建并返回</button>
			</div>
		
		</section>
	</article>
</body>
<script data-main="../js/page/b1_supplier" src="../lib/requirejs/require.js"></script>
	<script type="text/javascript" src="../lib/jquery/dist/jquery.js"></script>
	<script type="text/javascript" src="../lib/jquery/dist/ajaxfileupload.js"></script>
	<script type="text/javascript" src="../js/page/b2_order.js"></script>
	<script type="text/javascript">
	$(function() {  
	    $("#checkall").click(function() {  
	    	if(this.checked)
	        {
	        	$("input[name='salesOrderIndex']").prop("checked",true);
	        }
	        else
	        {
	        	$("input[name='salesOrderIndex']").prop("checked",false);
	        }
	    }); 
	}); 
</script>

<script language="JavaScript"> 
javascript:window.history.forward(1); 
</script> 
</html>